
cflags =  -g  -Wall -Wstrict-prototypes \
              -march=i386 -mregparm=3 \
              -include code16gcc.h \
              -fno-strict-aliasing -fomit-frame-pointer \
              -ffreestanding \
              -fno-toplevel-reorder\
              -fno-unit-at-a-time \
              -fno-stack-protector \
              -mpreferred-stack-boundary=2 \
              -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
              -pipe \
              -m32

aflags =  ${cflags} -D__ASSEMBLY__
ldflags = -m elf_i386

default : simple_elf

simple_elf : entry.s.o libs16.s.o 
	ld ${ldflags} -T simple.ld -o kernel.bin $?
	mdel c:/kernel.bin
	mcopy kernel.bin c:/

libs16.s.o : libs16.s
	gcc ${aflags} -c $< -o $@

entry.s.o: entry.s
	gcc ${aflags} -c $< -o $@

clean:
	rm -f *.o
	rm -f *.bin

